# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         demo06
# Description:
# Author:       98745
# Date:         2019/3/10
#-------------------------------------------------------------------------------
import json
class product:
    def __init__(self,name,price,count):
        self.name=name
        self.price=price
        self.count=count

def pd(obj):
    return {'name':obj.name,'price':obj.price,'count':obj.count}
pro=product('特斯拉',100000,20)
js=json.dumps(pro,default=pd,ensure_ascii=False)
print(js  )